@import '~antd/es/style/themes/default.less';

html,
body,
#root {
  height: 100%;
}

.colorWeak {
  filter: invert(80%);
}

canvas {
  display: block;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

ul,
ol {
  list-style: none;
}

@media (max-width: @screen-xs) {
  .ant-table {
    width: 100%;
    overflow-x: auto;
    &-thead > tr,
    &-tbody > tr {
      > th,
      > td {
        white-space: pre;
        > span {
          display: block;
        }
      }
    }
  }
}

// TODO
.ant-table-tbody > tr > td {
  word-wrap: break-word;
  word-break: break-all;
}

/* fix border-bottom is missing when ant-table-tbody is shorter than ant-table-body  */
.ant-table-body > table {
  border-bottom: 1px solid #e8e8e8 !important;
}

.ant-table-bordered .ant-table-placeholder {
  border-top: 0 !important;
}

/* 滚动条整体 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background-color: #fff;
}

/* 滑块 */
::-webkit-scrollbar-thumb {
  background-color: rgba(144, 147, 153, 0.1);
  border-radius: 4px;
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(144, 147, 153, 0.3);
}

/* 分页总数  */
.screen-md,
.screen-lg,
.screen-xl {
  .ant-pagination.ant-table-pagination {
    .ant-pagination-total-text {
      position: absolute;
      left: 0;
    }
  }
}

.ant-col.ant-form-item-label {
  margin-right: 5px;
}

.wrap-label {
  .ant-form-item-label {
    white-space: normal;
  }
}

.ant-layout .ant-pro-tabsLayout-content {
  margin: 0;
}

.ant-pro-fixed-header + .ant-pro-tabsLayout-content {
  padding-top: 118px;

  .ant-pro-page-content-wrap {
    .ant-pro-page-content-wrap-tabs {
      > .ant-tabs-content {
        height: calc(100vh - 118px);
        overflow-y: scroll;
      }
    }

    .ant-pro-page-content-wrap-children-content {
      min-height: calc(100vh - 190px);
    }
  }

  .ant-modal-wrap,
  .ant-modal-mask {
    position: absolute;
  }

  .ant-modal-wrap[role='dialog'] {
    &.wm-modal-wrap-fullscreen {
      .ant-modal {
        height: calc(100vh - 118px) !important;
        .ant-modal-body {
          height: calc(100vh - 226px) !important;
        }
      }
      &.wm-modal-wrap-nofooter {
        .ant-modal-body {
          height: calc(100vh - 173px) !important;
        }
      }
    }
  }
}

/* limit modal dialog's height */
.ant-modal-wrap[role='dialog'] {
  .ant-modal {
    max-height: calc(100vh - 30px);
    .ant-modal-body {
      max-height: calc(100vh - 140px);
      overflow-y: scroll;
    }
  }
  &.wm-modal-wrap-nofooter {
    .ant-modal-body {
      max-height: calc(100vh - 87px);
    }
  }
}

.wm-modal-wrap-fullscreen {
  .ant-modal {
    width: 100% !important;
    height: 100vh !important;
    max-height: none !important;

    .ant-modal-content,
    .ant-modal-header,
    .ant-modal-footer {
      border-radius: 0;
    }

    .ant-modal-body {
      height: calc(100vh - 108px) !important;
      max-height: none !important;
    }
  }
  &.wm-modal-wrap-nofooter {
    .ant-modal-body {
      height: calc(100vh - 55px) !important;
    }
  }
}

.ant-pro-tabsLayout-content {
  .ant-modal-wrap[role='dialog'] {
    .ant-modal {
      max-height: calc(100vh - 148px);
      .ant-modal-body {
        max-height: calc(100vh - 256px);
        overflow-y: scroll;
      }
    }
    &.wm-modal-wrap-nofooter {
      .ant-modal-body {
        max-height: calc(100vh - 203px);
      }
    }
  }
}

.wm-modal-wrap {
  .ant-modal-close {
    top: 14px;
    right: 14px;
    .ant-modal-close-x {
      width: 28px;
      height: 28px;
      line-height: 28px;
    }
  }
}

.ant-layout-sider-collapsed .ant-pro-sider-menu-logo img {
  height: 32px !important;
}

.ant-pro-sider-menu-logo img {
  height: 64px !important;
}

/* tab */
.ant-pro-page-content-wrap-children-content {
  margin: 12px 12px 0 !important;
}

.ant-pro-page-content-wrap-tabs.ant-tabs > div:first-child .ant-tabs-bar .ant-tabs-tab {
  border: none !important;
  border-bottom: 1px solid transparent !important;
}

.ant-pro-page-content-wrap-tabs.ant-tabs > div:first-child .ant-tabs-bar .ant-tabs-tab-active {
  border-color: #1890ff !important;
}
.ant-pro-page-content-wrap-tabs.ant-tabs.ant-tabs-card
  > div:first-child
  .ant-tabs-card-bar
  .ant-tabs-tab {
  background-color: #fff;
}

.ant-pro-page-content-wrap-tabs.ant-tabs
  .ant-tabs-card-bar
  > div:first-child
  .ant-tabs-tab
  .ant-tabs-close-x {
  visibility: hidden;
}

.ant-pro-page-content-wrap-tabs.ant-tabs
  .ant-tabs-card-bar
  > div:first-child
  .ant-tabs-tab:hover
  .ant-tabs-close-x {
  visibility: visible;
}

.ant-pro-page-content-wrap-tabs.ant-tabs
  .ant-tabs-card-bar
  > div:first-child
  .ant-tabs-tab
  .ant-tabs-close-x:hover {
  color: rgba(0, 0, 0, 0.85);
}
